<template>
  <view class="empty">
    <view class="content">
      <image :src="'/static/icon/components/'+img+'.png'" class="img-e"/>
      <view class="text"> {{ txt }} </view>
			<view class="btn" v-if="btnText" @tap="tapBtn"> {{ btnText }} </view>
    </view>
  </view>
</template>

<script setup>
	defineProps({
		txt: {
			type: String,
			default: '暂无符合搜索条件的商品哦'
		},
		btnText: {
			type: String,
			default: ''
		},
		img: {
			type: String,
			default: 'empty'
		}
	})
	const emit = defineEmits(['tapBtn'])
	const tapBtn = () => {
		emit('tapBtn','')
	}
</script>

<style lang="scss" scoped>
.empty {
  .content {
    padding: 30px;
    text-align: center;
    .img-e {
			margin-top: 80px;
      width: 160px;
      height: 160px;
    }
    .text {
      margin-top: 14px;
      height: 14px;
      font-size: 12px;
      color: #999999;
      line-height: 14px;
    }
		.btn {
			width: 102px;
			height: 40px;
			color: #FFFFFF;
			font-size: 16px;
			font-weight: 400;
			margin: 20px auto;
			line-height: 40px;
			background: #FF3B1E;
			border-radius: 99px;
		}
  }
}
</style>